package payroll.trans;

import payroll.Employee;
import payroll.PayrollDatabase;
import payroll.classfication.PaymentClassfication;
import payroll.method.HoldMethod;

public abstract class AddEmployeeTransation implements Transaction{
    private int empId;
    private String name;
    private String address;


    public AddEmployeeTransation(int empId, String name, String address) {
        this.empId = empId;
        this.name = name;
        this.address = address;
    }
    public void execute() {
        Employee e = new Employee(empId, name, address);
        e.setPaymentClassification( getPaymentClassification());
        e.setPaymentMethod(new HoldMethod());
        PayrollDatabase.save(e);
    } 
    protected abstract PaymentClassfication getPaymentClassification();
    
}
